#!/bin/sh
#
# $OpenBSD: trytond.rc,v 1.3 2015/07/15 14:59:15 ajacoutot Exp $

daemon="${TRUEPREFIX}/bin/trytond"
daemon_user="_tryton"

. /etc/rc.d/rc.subr

pexp="${MODPY_BIN} ${daemon}${daemon_flags:+ ${daemon_flags}}"
rc_bg=YES
rc_reload=NO

rc_pre() {
	touch /var/log/trytond
	chown _tryton:_tryton /var/log/trytond
}

# XXX hangs forever
rc_stop() {
	pkill -9 -xf "${pexp}"
}

rc_cmd $1
